import logging
from datetime import datetime

from auditlog.context import disable_auditlog, set_actor
from django.contrib.auth import authenticate, get_user
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.views.decorators.http import require_http_methods

from customauth.models import MyUser
from .models import Periods


def test_logs() -> None:
    actor = MyUser.objects.get(login="antipov.ka")
    with set_actor(actor):
        s = Periods.objects.create(years=2024, months=4, nmonth="24 Апрель", dn_pl="2024-03-26", dk_pl="2024-04-25", dn_lg="2024-03-21", dk_lg="2024-04-20")
        print(s)
